package com.ccjk.beusoft.hot;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.ccjk.beusoft.hot.fragment.LifeCycle;

import java.util.ArrayList;
import java.util.List;

import beusoft.ccjk.com.apt_anno.anno.ViewInjector;

public class GlideActivity extends AppCompatActivity {
    private List<String> urls = new ArrayList<>();

    @ViewInjector(R.id.fab)
    FloatingActionButton mFloatingActionButton;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_glide);
        findViewById(R.id.fab).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                testGlide();
            }
        });
        urls.add("http://www.marstranslator.com/storage/cover_images/tc_gallery_home_03c-1542336156.jpg");
        urls.add("http://www.marstranslator.com/storage/cover_images/crested-ibis-pic-2-1539182346.jpg");

//        GlideActivity$InjectAdapter df;
//        addLifeCycleFragment();
    }

    private void addLifeCycleFragment() {
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        transaction.add(R.id.container, new LifeCycle());
//        transaction.add(new LifeCycle(),"Lifecycle");
        transaction.commit();
    }

    private void testGlide() {
//        GlideApp.with(this).load(urls.get(0)).into((ImageView) findViewById(R.id.iv_3));
//        getApplication().registerActivityLifecycleCallbacks();
    }
}
